class timer extends Thread{
        
	int seq; //indicate which packet this time is for
        
    public timer(int seq){
    	this.seq = seq;
    	start();
    }

    public void run(){
    	try {
    		sleep(500);
        } catch (InterruptedException e) {
        }

        if(seq == gbnnode.base){
        	System.out.println(gbnnode.currentTime()+"Packet"+seq+" timeout.");
            gbnnode.nextPacketToSend = seq;
        }
    }
}